<?php
require_once("../includes/config.php"); 
  //make sure the person in authorized
  if ($_SESSION["r"]>1)
  {
  	$_SESSION['error_message'] = "غير مسموح";
	redirect("index.php");
	die();
  }


if($_SERVER["REQUEST_METHOD"] == "POST")
  {
  $apart=$_POST['apart'];
  $furn = $_POST['furn'];
  $descrip =$_POST['descrip'];
  $price=$_POST['price'];
  $status =$_POST['status'];
  $source=$_POST['source'];
  
  $result = query("INSERT INTO furnitures(apartments_id , furniture, descrip, price,fur_status 
	                 ,source) VALUES (?,?,?,?,?,?) ", 
      $apart,$furn,$descrip,$price,$status,$source);
	  
  
  
    redirect("furnitures.php?apart=".$apart);
  
  }
  ?>